package com.xhwl.centiotdata.controller;

import com.xhwl.centiotdata.integration.IntegrationCategoryEnum;
import com.xhwl.centiotdata.integration.IntegrationProductsEnum;
import com.xhwl.common.pojo.ResultBuilder;
import com.xhwl.common.pojo.ResultJson;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 集成服务接口
 */
@RestController
public class IntegrationController {

    @GetMapping("/integration/category/list")
    public ResultJson<List<String>> onListingCategory(@RequestParam("name")String name) {
        List<String> list = IntegrationCategoryEnum.onListing(name);
        return ResultBuilder.success(list);
    }

    @GetMapping("/integration/products/list")
    public ResultJson<List<String>> onListingProducts(@RequestParam("name")String name) {
        List<String> list = IntegrationProductsEnum.onListing(name);
        return ResultBuilder.success(list);
    }

}
